/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package levels;

import graphics.AbstractRenderer;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;

/**
 *
 * @author Joshua
 */
public class LevelManager {

    public static Level currentLevel = new TestLevelSkeleton();

    public static void loadLevel(AbstractRenderer r, File f, short Level_ID) {
        currentLevel = new TestLevelSkeleton();
        currentLevel.loadTwoPlayerGame();
        try {
            r.setBackgroundImage(ImageIO.read(currentLevel.getLevelBackgroundImage()));
        } catch (IOException e) {
            System.err.println("Could not load background image");
            System.exit(1);
        }
    }

    public static URL getBackground() {
        return currentLevel.getLevelBackgroundImage();
    }

    /**
     * REturns true if the rendering process requires a second post player draw
     * @param r
     * @return
     */
    public static boolean handOff(AbstractRenderer r) {
        currentLevel.addRendereringInstructions(r);
        return false;//unimplemented
    }
}
